package cn.com.xyc.common;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ApplicationConstants {
	public static String endpoint;
	public static String accessKeyId;
	public static String accessKeySecret;
	public static String interAddress;
	public static String attachPath;

	@Value("#{config['aliyun.endpoint']}")
	public void setEndpoint(String endpoint) {
		ApplicationConstants.endpoint = endpoint;
	}

	@Value("#{config['aliyun.accessKeyId']}")
	public void setAccessKeyId(String accessKeyId) {
		ApplicationConstants.accessKeyId = accessKeyId;
	}

	@Value("#{config['aliyun.accessKeySecret']}")
	public void setAccessKeySecret(String accessKeySecret) {
		ApplicationConstants.accessKeySecret = accessKeySecret;
	}

	@Value("#{config['inter.address']}")
	public void setInterAddress(String interAddress) {
		ApplicationConstants.interAddress = interAddress;
	}

	@Autowired(required = true)
	private void setAttachPath(
			@Value("#{config['attachPath']}") String attachPath) {
		ApplicationConstants.attachPath = attachPath;
	}
}
